import request from './request'

export default {
  login(data) {
    return request({
      url: 'http://localhost:8000/user/login',
      method: 'get',
      params: {
            data
          }
    })
  },
  logout(data) {
    return request({
      url: 'http://localhost:8000/user/logout',
      method: 'get',
      params: {
            data
          }
    })
  },
  Register(data) { //输入用户名后，左侧出现判断是否存在  ///???user_id?
    return request({
      url: 'http://localhost:8000/user/register',
      method: 'get',
      params: {
            data
          }
    })
  },
  addCourse(data) {  //增加课程
    return request({
        url: 'http://localhost:8000/user/addCourse',
        method: 'get',
        params: {
            data
          }
      })
  },
  addSingle(data) {  //增加一个学生
    return request({
        url: 'http://localhost:8000/user/addSingle',
        method: 'get',
        params: {
            data
          }
      })
  },
  delSingle(data) {  //删除一个学生
    return request({
        url: 'http://localhost:8000/user/delSingle',
        method: 'get',
        params: {
            data
          }
      })
  },
  // addExl(data) {  //导入表格
  //   return request({
  //       url: '/API/user/addExl/',
  //       method: 'post',
  //       data
  //     })
  // },

  calScore(data) {  //data为获取到的权重，后台按照权重计算成绩
    return request({
        url: 'http://localhost:8000/user/calScore',
        method: 'get',
        params: {
            data
          }
      })
  },
  getStudent(data) {  //获取学生列表
    return request({
        url: 'http://localhost:8000/user/getStudent',
        method: 'get',
        params: {
            data
          }
      })
  },
  saveWeight(data) {  //
    return request({
        url: 'http://localhost:8000/user/calScore',
        method: 'get',
        params: {
            data
          }
      })
  },
  calculation(data) {
    return request({
        url: 'http://localhost:8000/user/calculation',
        method: 'get',
        params: {
            data
          }
      })
  }
}
